const Mock = require('mockjs');
const util = require('./utils');

function formatResponse(data) {
  return {
    code: 200,
    message: '成功',
    data
  }
}

module.exports = function(app){
    app.post('/api/auth/login', function (rep, res) {
        var json = util.getJsonFile('./api.json');
        res.json(formatResponse(Mock.mock(json.login)));
    });
}